from app import create_app
from flask import render_template, jsonify

app = create_app()


@app.route('/')
def index():
    return render_template("index.html")


@app.route('/api/user')
def getMenu():
    data = {}
    data['user'] = {
        "name": 'xueke',
        "login": True,
    }
    data['menu'] = [
        {
            "title": '虚拟机',
            "icon": 'cloud',

            "link": '#',
            "id": 1,
            "children": [
                {
                    "title": '镜像',
                    "icon": 'cloud',
                    "link": '/docker/image',
                    "id": 3,
                },
                {
                    "title": '容器',
                    "icon": 'cloud',
                    "link": '/docker/container',
                    "id": 2,

                }
                ,
                {
                    "title": '网络',
                    "icon": 'cloud',
                    "link": '/docker/network',
                    "id": 4,
                }
            ]
        }
    ]

    return jsonify(data)


if __name__ == '__main__':
    app.run(debug=app.config['DEBUG'], host=app.config['HOST'])
